{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from vedo import *\n",
    "from vedo.pyplot import histogram\n",
    "embedWindow('2d')\n",
    "\n",
    "np.random.seed(3)\n",
    "data1 = np.random.randn(250)\n",
    "data2 = (np.random.rand(250)-0.5)*12\n",
    "\n",
    "hst1 = histogram(data1,\n",
    "                 bins=30,\n",
    "                 errors=True,\n",
    "                 aspect=4/3,\n",
    "                 title='My distributions',\n",
    "                 c='red',\n",
    "                 marker='o',\n",
    "                )\n",
    "\n",
    "# pick the 16th bin and color it violet\n",
    "hst1.unpack(15).c('violet')\n",
    "hst1 += Text3D('Highlight a\\nspecial bin', pos=(0.5,20), c='v')\n",
    "\n",
    "# A second histogram:\n",
    "# make it in same format as hst1 so it can be superimposed\n",
    "hst2 = histogram(data2, format=hst1, alpha=0.5)\n",
    "\n",
    "# Show both:\n",
    "show(hst1, hst2, zoom=1.3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
